package com.rcoming.base;

import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.WindowManager;

/**
 * Created by mjb on 2017/4/13.
 */

public class BaseActivity extends AppCompatActivity {

    protected Activity context;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        steepStatusBar();
        super.onCreate(savedInstanceState);
        init();
    }

    private void init() {
        context = this;
    }

    /**
     * [沉浸状态栏]
     */
    private void steepStatusBar() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            // 透明状态栏
            getWindow().addFlags(
                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            // 透明导航栏
            getWindow().addFlags(
                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        }
    }

}
